local skel = fk.CreateSkill {
  name = "emo__ningzuowu",
}

Fk:loadTranslationTable{
  ["emo__ningzuowu"] = "宁作吾",
  [":emo__ningzuowu"] = "你可将三张手牌作【酒】使用，不足，便不足。",

  ["#emo__ningzuowu"] = "宁作吾:将3张手牌作【酒】使用，不足则全部",

  ["$emo__ningzuowu1"] = "折戟沉沙，壮志未酬。",
  ["$emo__ningzuowu2"] = "沙场埋恨何时绝？",
}

skel:addEffect("viewas", {
  anim_type = "offensive",
  prompt = "#emo__ningzuowu",
  mute_card = true,
  pattern = "analeptic",
  card_filter = function (self, player, to_select, selected)
    local num = math.min(player:getHandcardNum(), 3)
    return #selected < 3 and table.contains(player.player_cards[Player.Hand], to_select)
  end,
  filter_pattern = {
    min_num = 1,
    max_num = 999,
    pattern = ".|.|.|hand",
  },
  view_as = function (self, player, cards)
    local hand = player:getHandcardNum()
    if #cards == 0 then return nil end
    if #cards ~= math.min(hand, 3) then return nil end
    local c = Fk:cloneCard("analeptic")
    c.skillName = skel.name
    c:addSubcards(cards)
    return c
  end,
  enabled_at_play = function(self, player)
    return not player:isKongcheng()
  end,
  enabled_at_response = function (self, player, response)
    return not response and not player:isKongcheng()
  end,
})

return skel
